package com.dycn.posdashboard.dao.impl;

import com.dycn.posdashboard.dao.BaseDaoImpl;
import com.dycn.posdashboard.dao.LoginDao;
import com.dycn.posdashboard.data.User;
import com.dycn.posdashboard.dbhelper.DbContextHolder;

public class LoginDaoImpl extends BaseDaoImpl implements LoginDao {

    public Object checkUser(String dbType, User ue) {
    	log.debug("checkUser thread id:"+Thread.currentThread().getId());
        DbContextHolder.setDbSource(dbType);
        log.debug("checkUser dbType=" + dbType);
        return this.getSqlMapClientTemplate().queryForObject("checkUserLogin", ue);
    }

    public User findUserInfoByUserName(String dbType, User ue) {
        DbContextHolder.setDbSource(dbType);
        log.debug("findUserInfoByUserName dbType=" + dbType);
        return (User) this.getSqlMapClientTemplate().queryForObject("findUserInfoByUserName", ue);
    }
//
//    public DbUserInfo findUserDBInfoByUserName(String dbType, User ue) {
//        DbContextHolder.setDbSource(dbType);
//        log.debug("findUserDBInfoByUserName dbType=" + dbType);
//        return (DbUserInfo) this.getSqlMapClientTemplate().queryForObject("findUserDBInfoByUserName", ue);
//    }
}